<template>
  <el-dialog
    :before-close="beforeClose"
    :visible.sync="show"
    :title="title"
    width="840px"
    @close="close"
    @closed="closed"
  >
    <div>
      <el-button type="success" @click="handleAdopt">导出资料</el-button>
      <el-button type="danger" @click="handleRefuse">解除所有异常</el-button>
      <el-button type="danger" @click="handleRefuse">重点关注</el-button>
    </div>
    <div class="k-box-flex k-mt-20">
      <div class="photo">
        <span>个人实名照片</span>
        <img src="" alt="">
      </div>
      <div class="info k-ml-20">
        <el-descriptions class="margin-top" title="" :column="1" size="small" border>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-user" />
              姓名
            </template>
            kooriookami
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-user" />
              性别
            </template>
            kooriookami
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-user" />
              年龄
            </template>
            kooriookami
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-mobile-phone" />
              身份证号码
            </template>
            18100000000
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-mobile-phone" />
              手机号
            </template>
            18100000000
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-location-outline" />
              户籍地址
            </template>
            江苏省苏州市吴中区吴中大道 1188 号
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-location-outline" />
              现居地址
            </template>
            江苏省苏州市吴中区吴中大道 1188 号
          </el-descriptions-item>
        </el-descriptions>
      </div>
      <div class="work k-ml-20">
        <el-descriptions class="margin-top" title="" :column="1" size="small" border>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-user" />
              人才引进
            </template>
            kooriookami
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-user" />
              就业情况
            </template>
            kooriookami
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-user" />
              在职公司
            </template>
            kooriookami
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-mobile-phone" />
              在职岗位
            </template>
            18100000000
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-mobile-phone" />
              工作时段
            </template>
            18100000000
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-location-outline" />
              公司地址
            </template>
            江苏省苏州市吴中区吴中大道 1188 号
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-location-outline" />
              工作状况
            </template>
            江苏省苏州市吴中区吴中大道 1188 号
          </el-descriptions-item>
        </el-descriptions>
      </div>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="handleClose">取 消</el-button>
      <el-button type="primary" @click="handleSubmit">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
import { ssqOptions, streetOptions, adminOptions } from '@/list/data'
export default {
  name: 'Detail',
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    data: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      show: false,
      ssqOptions,
      streetOptions,
      adminOptions,
      form: {
        ssq: '',
        street: '',
        admin: '',
        remark: ''
      }
    }
  },
  computed: {
    title() {
      const text = '张三的个人资料'
      return text
    }
  },
  watch: {
    visible(val) {
      if (val) {
        this.show = val
      }
    }
  },
  mounted() {
    this.show = this.visible
  },
  methods: {
    handleChange(value) {
      console.log(value)
    },
    getData() {
      console.log('获取数据')
    },
    handleClose() {
      console.log('点击关闭')
      this.beforeClose()
    },
    handleAdopt() {
      console.log('通过')
      this.$notify.success('通过')
      this.handleClose()
    },
    handleRefuse() {
      console.log('拒绝')
      this.$notify.error('拒绝')
      this.handleClose()
    },
    handleSubmit() {
      console.log('点击确定')
      this.$notify.success('保存成功')
      this.handleClose()
    },
    beforeClose() {
      console.log('关闭前的回调')
      this.show = false
      this.$emit('update:visible', false)
    },
    close() {
      console.log('关闭的回调')
    },
    closed() {
      console.log('关闭动画结束后的回调')
    }
  }
}
</script>

<style scoped>

</style>
